<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Neon Admin Panel">
    <meta name="author" content="">

    <title>Green Soil | 产品计算</title>

    <link rel="stylesheet" href="static/css/jquery-ui-1.10.3.custom.min.css">
    <link rel="stylesheet" href="static/css/entypo.css">
    <link rel="stylesheet" href="static/css/css.css">
    <link rel="stylesheet" href="static/css/bootstrap.css">
    <link rel="stylesheet" href="static/css/neon-core.css">
    <link rel="stylesheet" href="static/css/neon-theme.css">
    <link rel="stylesheet" href="static/css/neon-forms.css">
    <link rel="stylesheet" href="static/css/custom.css">
    <script src="./gethost.js" type="text/javascript"></script>
    <script src="static/js/jquery-1.11.0.min.js"></script>

    <!--[if lt IE 9]>
    <script src="assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body class="page-body">

<div class="page-container">
    <!-- add class "sidebar-collapsed" to close sidebar by default, "chat-visible" to make chat appear always -->

    <div class="sidebar-menu">

        <header class="logo-env">

            <!-- logo -->
            <div class="logo">
                <a href="">
                    <img src="static/picture/green.png" width="150" alt="">
                </a>
            </div>

            <!-- logo collapse icon -->

            <div class="sidebar-collapse">
                <a href="#" class="sidebar-collapse-icon with-animation">
                    <!-- add class "with-animation" if you want sidebar to have animation during expanding/collapsing transition -->
                    <i class="entypo-menu"></i>
                </a>
            </div>

            <!-- open/close menu icon (do not remove if you want to enable menu on mobile devices) -->
            <div class="sidebar-mobile-menu visible-xs">
                <a href="#" class="with-animation">
                    <!-- add class "with-animation" to support animation -->
                    <i class="entypo-menu"></i>
                </a>
            </div>

        </header>

        <ul id="main-menu" class="">
            <!-- add class "multiple-expanded" to allow multiple submenus to open -->
            <!-- class "auto-inherit-active-class" will automatically add "active" class for parent elements who are marked already with class "active" -->
            <!-- 搜索框 -->
            <li id="search">
                <form method="get" action="" enctype="multipart/form-data">
                    <input type="text" name="q" class="search-input" id="什么是" placeholder="请输入你想搜索的内容....">
                    <button type="submit">
                        <i class="entypo-search" id="submit"></i>
                    </button>
                </form>
            </li>

            <li>
                <a href="system-index.html">
                    <i class="entypo-home active"></i>
                    <span>首页</span>
                </a>
            </li>

            <li class="">
                <a href="">
                    <i class="entypo-database"></i>
                    <span>产品库</span>
                </a>
                <ul>
                    <li class="">
                        <a href="product-info.html">
                            <span>产品信息库</span>
                        </a>
                    </li>
                    <li>
                        <a href="function-info.html">
                            <span>功能信息库</span>
                        </a>
                    </li>
                    <li>
                        <a href="part-info.html">
                            <span>零件信息库</span>
                        </a>
                    </li>
                </ul>
            </li>
            <li class="">
                <a href="">
                    <i class="entypo-lamp"></i>
                    <span>计算方法</span>
                </a>
                <ul>
                    <li>
                        <a href="calculate-method.html">
                            <span>方法库</span>
                        </a>
                    </li>
                </ul>
            </li>
            <li class="">
                <a href="">
                    <i class="entypo-rocket "></i>
                    <span>计算</span>
                </a>
                <ul>
                    <li class="">
                        <a href="product-cal.html">
                            <span>产品计算</span>
                        </a>
                    </li>
                </ul>
            </li>
            <li class=" opened">
                <a href="">
                    <i class="entypo-chart-bar"></i>
                    <span>结果展示</span>
                </a>
                <ul>
                    <li class="active">
                        <a href="product-result.html">
                            <span>产品结果</span>
                        </a>
                    </li>
                </ul>
            </li>
            <li class="">
                <a href="">
                    <i class="entypo-layout"></i>
                    <span>背景数据管理</span>
                </a>
                <ul>
                    <li class="">
                        <a href="manufacture-info.html">
                            <span>工艺数据管理</span>
                        </a>
                    </li>
                    <li>
                        <a href="transport-info.html">
                            <span>运输数据管理</span>
                        </a>
                    </li>
                    <li>
                        <a href="material-info.html">
                            <span>材料数据管理</span>
                        </a>
                    </li>
                </ul>
            </li>
            <li>
                <a href="about-us.html">
                    <i class="entypo-info-circled"></i>
                    <span>关于我们</span>
                </a>
            </li>

        </ul>

    </div>
    <div class="main-content">

        <div class="row">

            <!-- Profile Info and Notifications -->
            <div class="col-md-6 col-sm-8 clearfix">

                <ul class="user-info pull-left pull-none-xsm">
                    <!-- 个人简介 -->
                    <li class="profile-info dropdown">
                        <!-- add class "pull-right" if you want to place this from right -->
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">

                            <img src="static/picture/head1.png" alt="" class="img-circle" width="44">
                            <a id="username"></a>
                        </a>
                    </li>
                </ul>

            </div>

            <!-- 退出按钮 -->
            <!-- 退出按钮 -->
            <div class="col-md-6 col-sm-4 clearfix hidden-xs">
                <ul class="list-inline links-list pull-right">
                    <li>
                        <a href="index.html" >
                            <strong>Log Out</strong> <i class="entypo-logout  right"></i>
                        </a>
                    </li>
                    <li class="sep"></li>
                </ul>


                <ul class="list-inline links-list pull-right" >
                    <li>
                        <a href="play/Excel表模板.zip" >
                            <strong>Download</strong> <i class="entypo-attach left" ></i>
                        </a>
                    </li>
                    <li class="sep"></li>
                </ul>

                <ul class="list-inline links-list pull-right" >
                    <li>
                        <a data-toggle="modal" data-target="#bomtips">
                            <strong>Bom Tips </strong><i class="entypo-github left"  ></i>
                        </a>
                    </li>
                    <li class="sep"></li>
                </ul>

            </div>

        </div>
        <hr>
        <ol class="breadcrumb bc-3">
            <li>
                <a href="system-index.html"><i class="entypo-home"></i>首页</a>
            </li>
            <li>
                <a>结果展示</a>
            </li>
            <li class="active">
                <strong>产品结果展示</strong>
            </li>
        </ol>

        <table class="table table-bordered datatable" id="table-1">
            <thead>
            <tr>
                <th>ID</th>
                <th>产品名称</th>
                <th>产品名称</th>
                <th>产品系列号(s)</th>
                <th>产品厂家</th>
                <th>地区</th>
                <th>产品产地</th>
                <th>目的地</th>
                <th width="70"> 产品功率</th>
                <th width="70">运输距离</th>
                <th width="70">产品寿命</th>
                <th width="100">产品重量</th>
                <th>产品参数</th>
                <th width="400">备注</th>
                <th width="250px">操作</th>
            </tr>
            </thead>
            <tbody>

            </tbody>
        </table>

        <script type="text/javascript">
            var responsiveHelper;  //分页设置
            var breakpointDefinition = {  //不同设备显示
                tablet: 1024,
                phone: 480
            };
            var tableContainer;
            var products;   //产品集合
            var userinfo;  //用户信息
            var productInfo;//产品详细信息
            var nodesize=[];
            //当DOM载入就绪可以查询及操纵时绑定一个要执行的函数
            jQuery(document).ready(function ($) {
                var token = window.localStorage["token"];
                if (token == null || token == "") {
                    alert("没有登录，不能下单");
                    window.location.href = "login.html";
                    return false;
                }
                $.ajax({
                    type: "POST",
                    url: "http://" + g_host + "/user/getuserinfo",
                    xhrFields: {withCredentials: true},
                    data: {
                        "token": token
                    },
                    success: function (data) {
                        if (data.status == "success") {
                            userinfo = data.data;
                            $("#username").text(userinfo.username);
                            $.ajax({
                                type: "GET",
                                url: "http://" + g_host + "/cal/getAll?id=" + userinfo.id,
                                xhrFields: {withCredentials: true},
                                success: function (data) {
                                    if (data.status == "success") {
                                        products = data.data;
                                        reloadDom();
                                    } else {
                                        alert("获取产品信息失败，原因为" + data.data.errMsg);
                                    }
                                },
                                error: function (data) {
                                    alert("获取产品信息失败，原因为服务器内部错误" + data.data.errMsg);
                                    window.location.href = "login.html";
                                }
                            })
                        } else {
                            alert("登录信息过期！请重新登录！");
                            window.location.href = "login.html";
                        }
                    },
                    error: function (data) {
                        alert("登录失败，原因为服务器内部错误");
                        window.location.href = "login.html";
                    }
                });


                tableContainer = $("#table-1");
                //表格设置
                tableContainer.dataTable({
                    "sPaginationType": "bootstrap",
                    "iDisplayLength": 10000,
                    "aLengthMenu": [[-1, 12, 20, 40, 80], ["All", 12, 20, 40, 80]],
                    "bStateSave": true,
                    "bInfo": true,
                    "aoColumns": [
                        {"sTitle": "ID"},
                        {"sTitle": "计算名称"},
                        {"sTitle": "计算产品"},
                        {"sTitle": "计算方法"},
                        {"sTitle": "使用次数"},
                        {"sTitle": "产品功率"},
                        {"sTitle": "使用时间（单次）"},
                        {"sTitle": "时间单位"},
                        {"sTitle": "水资源消耗（kg）"},
                        {"sTitle": "汽油消耗（kg）"},
                        {"sTitle": "柴油消耗（kg）"},
                        {"sTitle": "天燃气消耗（kg）"},
                        {"sTitle": "备注"},

                        {"sTitle": "操作"},
                        {"sTitle": "productid", "bVisible": false},
                        {"sTitle": "userid", "bVisible": false}
                    ],

                    // Responsive Settings
                    bAutoWidth: false,
                    //页面加载的分页初始化方法
                    fnPreDrawCallback: function () {
                        // Initialize the responsive datatables helper once.
                        if (!responsiveHelper) {
                            responsiveHelper = new ResponsiveDatatablesHelper(tableContainer, breakpointDefinition);
                        }
                    },
                    fnRowCallback: function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
                        responsiveHelper.createExpandIcon(nRow);

                    },
                    fnDrawCallback: function (oSettings) {
                        responsiveHelper.respond();
                    },
                });

                $(".dataTables_wrapper select").select2({
                    minimumResultsForSearch: -1
                });
            });


            //加载表格数据
            function reloadDom() {

                for (var i = 0; i < products.length; i++) {
                    var dom = [(i + 1), products[i].name, products[i].product_name, "方法 " + products[i].method, products[i].usenum, products[i].power, products[i].time, products[i].timeUnit, products[i].water, products[i].gasoline, products[i].dieseloil, products[i].gas,
                        products[i].comments,
                        "<td>\n" +
                        "<a href=\"#\" class=\"btn btn-default btn-sm btn-icon icon-left\"  style=' width: 90px;margin-left: 5px'  id=\"info" + products[i].id + "v" + products[i].productId + "\"  data-toggle=\"modal\" data-target=\"#list_detail0\">\n" +
                        "<i class=\"entypo-keyboard\"></i>列表结果\n" +
                        "<a href=\"#\" class=\"btn btn-success btn-sm btn-icon icon-left\"  style='width: 90px;margin-left: 5px'  id=\"grap" + products[i].id + "v" + products[i].productId + "\"  data-toggle=\"modal\" data-target=\"#list_detail1\">\n" +
                        "<i class=\"entypo-chart-bar\"></i>图表结果\n" +
                        "<a href=\"#\" class=\"btn btn-warning btn-sm btn-icon icon-left\"  style='width: 90px;margin-left: 5px'  id=\"meta" + products[i].id + "v" + products[i].productId + "\"  data-toggle=\"modal\" data-target=\"#list_detail2\">\n" +
                        "<i class=\"entypo-flow-tree\" ></i>多域关联\n" +
                        "<a href=\"#\" class=\"btn btn-danger btn-sm btn-icon icon-left\"  style='width: 80px;margin-left: 5px'  id=\"delete" + products[i].id + "v" + products[i].productId + "\"><i class=\"entypo-erase\" ></i>删除\n" +
                        "</a></td>"
                        , products[i].productId, products[i].userId];
                    $('#table-1').dataTable().fnAddData(dom);


                    //查看列表详情的方法
                    $("#info" + products[i].id + "v" + products[i].productId).on("click", function (e) {
                        var id = this.id;
                        id = id.substring(4, id.length);
                        var ids = new Array();
                        ids = id.split("v");
                        //submitid = id;
                        console.log(ids[0]);
                        console.log(ids[1]);
                        $.ajax({
                            type: "GET",
                            contentType: "application/x-www-form-urlencoded",
                            url: "http://" + g_host + "/result/getlist?calid=" + ids[0] + "&productid=" + ids[1],
                            xhrFields: {withCredentials: true},
                            success: function (data) {
                                if (data.status == "success") {
                                    $('#table-2').dataTable().fnClearTable();
                                    productInfo = data.data;
                                    reloadInfoDom();
                                } else {
                                    alert("查看详情失败，原因为" + data.data.errMsg);
                                    window.location.href = "product-result.html";
                                }
                            },
                            error: function (data) {
                                alert("查看详情失败，原因为" + data.responseText);
                                window.location.href = "product-result.html";
                            }
                        });

                    });


                    //查看图表详情的方法
                    $("#grap" + products[i].id + "v" + products[i].productId).on("click", function (e) {
                        var id = this.id;
                        id = id.substring(4, id.length);
                        var ids = new Array();
                        ids = id.split("v");


                        $.ajax({
                            type: "GET",
                            contentType: "application/x-www-form-urlencoded",
                            url: "http://" + g_host + "/result/getgraphlist?calid=" + ids[0] + "&productid=" + ids[1],
                            xhrFields: {withCredentials: true},
                            success: function (data) {
                                if (data.status == "success") {
                                    var product = data.data.productGraphVO;
                                    //产品图表展示
                                    var categorys = ['PED', 'GWP', 'AP', 'EP', 'POCP', 'ODP']
                                    var myChart = echarts.init(document.getElementById('graphmid')); //选取e-charts图表
                                    let xAxisData = [];
                                    let data1 = [];
                                    let data2 = [];
                                    let data3 = [];
                                    let data4 = [];
                                    let data5 = [];
                                    let data6 = [];
                                    for (let i = 0; i < 6; i++) {
                                        xAxisData.push(categorys[i]);
                                        if (i == 0) {
                                            data1.push(product.raw.ped);
                                            data2.push(product.raw_transport.ped);
                                            data3.push(product.manufacture.ped);
                                            data4.push(product.pro_transport.ped);
                                            data5.push(product.pro_use.ped);
                                            data6.push(product.pro_recycle.ped);
                                        } else if (i == 1) {
                                            data1.push(product.raw.gwp);
                                            data2.push(product.raw_transport.gwp);
                                            data3.push(product.manufacture.gwp);
                                            data4.push(product.pro_transport.gwp);
                                            data5.push(product.pro_use.gwp);
                                            data6.push(product.pro_recycle.gwp);
                                        } else if (i == 2) {
                                            data1.push(product.raw.ap);
                                            data2.push(product.raw_transport.ap);
                                            data3.push(product.manufacture.ap);
                                            data4.push(product.pro_transport.ap);
                                            data5.push(product.pro_use.ap);
                                            data6.push(product.pro_recycle.ap);
                                        } else if (i == 3) {
                                            data1.push(product.raw.ep);
                                            data2.push(product.raw_transport.ep);
                                            data3.push(product.manufacture.ep);
                                            data4.push(product.pro_transport.ep);
                                            data5.push(product.pro_use.ep);
                                            data6.push(product.pro_recycle.ep);
                                        } else if (i == 4) {
                                            data1.push(product.raw.pocp);
                                            data2.push(product.raw_transport.pocp);
                                            data3.push(product.manufacture.pocp);
                                            data4.push(product.pro_transport.pocp);
                                            data5.push(product.pro_use.pocp);
                                            data6.push(product.pro_recycle.pocp);
                                        } else if (i == 5) {
                                            data1.push(product.raw.odp);
                                            data2.push(product.raw_transport.odp);
                                            data3.push(product.manufacture.odp);
                                            data4.push(product.pro_transport.odp);
                                            data5.push(product.pro_use.odp);
                                            data6.push(product.pro_recycle.odp);
                                        }

                                    }

                                    var emphasisStyle = {
                                        itemStyle: {
                                            shadowBlur: 10,
                                            shadowColor: 'rgba(0,0,0,0.3)'
                                        }
                                    };
                                    option = {
                                        title: {
                                            text: '产品LCA分析结果-影响指标',
                                            subtext: '',
                                            left: 'center',

                                        },
                                        legend: {
                                            data: ['原材料采掘', '原材料运输', '制造阶段', '产品运输', '产品使用', '产品回收'],
                                            left: 'center',
                                            top: '5%'
                                        },
                                        toolbox: {
                                            feature: {
                                                magicType: {
                                                    type: ['stack']
                                                }
                                            }
                                        },
                                        tooltip: {},
                                        xAxis: {
                                            data: xAxisData,
                                            name: 'X Axis',
                                            axisLine: {onZero: true},
                                            splitLine: {show: false},
                                            splitArea: {show: false}
                                        },
                                        yAxis: {},
                                        grid: {
                                            bottom: 100
                                        },
                                        series: [
                                            {
                                                name: '原材料采掘',
                                                type: 'bar',
                                                stack: 'one',
                                                emphasis: emphasisStyle,
                                                data: data1
                                            },
                                            {
                                                name: '原材料运输',
                                                type: 'bar',
                                                stack: 'one',
                                                emphasis: emphasisStyle,
                                                data: data2
                                            },
                                            {
                                                name: '制造阶段',
                                                type: 'bar',
                                                stack: 'one',
                                                emphasis: emphasisStyle,
                                                data: data3
                                            },
                                            {
                                                name: '产品运输',
                                                type: 'bar',
                                                stack: 'one',
                                                emphasis: emphasisStyle,
                                                data: data4
                                            }
                                            ,
                                            {
                                                name: '产品使用',
                                                type: 'bar',
                                                stack: 'one',
                                                emphasis: emphasisStyle,
                                                data: data5
                                            }
                                            ,
                                            {
                                                name: '产品回收',
                                                type: 'bar',
                                                stack: 'one',
                                                emphasis: emphasisStyle,
                                                data: data6
                                            }
                                        ]
                                    };
                                    myChart.setOption(option);
                                    myChart.on('brushSelected', function (params) {
                                        var brushed = [];
                                        var brushComponent = params.batch[0];
                                        for (var sIdx = 0; sIdx < brushComponent.selected.length; sIdx++) {
                                            var rawIndices = brushComponent.selected[sIdx].dataIndex;
                                            brushed.push('[Series ' + sIdx + '] ' + rawIndices.join(', '));
                                        }
                                        myChart.setOption({
                                            title: {
                                                backgroundColor: '#333',
                                                bottom: 0,
                                                right: '10%',
                                                width: 100,
                                                textStyle: {
                                                    fontSize: 12,
                                                    color: '#fff'
                                                }
                                            }
                                        });
                                    });

                                    var myChartindex = echarts.init(document.getElementById('graphmid1')); //选取e-charts图表
                                    var categorys1 = ['原材料采掘', '原材料运输', '制造', '产品运输', '使用', '回收']
                                    let xAxisData1 = [];
                                    let data11 = [];
                                    let data21 = [];
                                    let data31 = [];
                                    let data41 = [];
                                    let data51 = [];
                                    let data61 = [];
                                    for (let i = 0; i < 6; i++) {
                                        xAxisData1.push(categorys1[i]);
                                        if (i == 0) {
                                            data11.push(product.raw.ped);
                                            data11.push(product.raw_transport.ped);
                                            data11.push(product.manufacture.ped);
                                            data11.push(product.pro_transport.ped);
                                            data11.push(product.pro_use.ped);
                                            data11.push(product.pro_recycle.ped);
                                        } else if (i == 1) {
                                            data21.push(product.raw.gwp);
                                            data21.push(product.raw_transport.gwp);
                                            data21.push(product.manufacture.gwp);
                                            data21.push(product.pro_transport.gwp);
                                            data21.push(product.pro_use.gwp);
                                            data21.push(product.pro_recycle.gwp);
                                        } else if (i == 2) {
                                            data31.push(product.raw.ap);
                                            data31.push(product.raw_transport.ap);
                                            data31.push(product.manufacture.ap);
                                            data31.push(product.pro_transport.ap);
                                            data31.push(product.pro_use.ap);
                                            data31.push(product.pro_recycle.ap);
                                        } else if (i == 3) {
                                            data41.push(product.raw.ep);
                                            data41.push(product.raw_transport.ep);
                                            data41.push(product.manufacture.ep);
                                            data41.push(product.pro_transport.ep);
                                            data41.push(product.pro_use.ep);
                                            data41.push(product.pro_recycle.ep);
                                        } else if (i == 4) {
                                            data51.push(product.raw.pocp);
                                            data51.push(product.raw_transport.pocp);
                                            data51.push(product.manufacture.pocp);
                                            data51.push(product.pro_transport.pocp);
                                            data51.push(product.pro_use.pocp);
                                            data51.push(product.pro_recycle.pocp);
                                        } else if (i == 5) {
                                            data61.push(product.raw.odp);
                                            data61.push(product.raw_transport.odp);
                                            data61.push(product.manufacture.odp);
                                            data61.push(product.pro_transport.odp);
                                            data61.push(product.pro_use.odp);
                                            data61.push(product.pro_recycle.odp);
                                        }

                                    }
                                    optionindex = {
                                        title: {
                                            text: '产品LCA分析结果-生命周期阶段',
                                            subtext: '',
                                            left: 'center',
                                        },
                                        legend: {
                                            data: ['PED', 'GWP', 'AP', 'EP', 'POCP', 'ODP'],
                                            left: 'center',
                                            top: '5%'
                                        },
                                        toolbox: {
                                            feature: {
                                                magicType: {
                                                    type: ['stack']
                                                }
                                            }
                                        },
                                        tooltip: {},
                                        xAxis: {
                                            data: xAxisData1,
                                            name: 'X Axis',
                                            axisLine: {onZero: true},
                                            splitLine: {show: false},
                                            splitArea: {show: false}
                                        },
                                        yAxis: {},
                                        grid: {
                                            bottom: 100
                                        },
                                        series: [
                                            {
                                                name: 'PED',
                                                type: 'bar',
                                                stack: 'one',
                                                emphasis: emphasisStyle,
                                                data: data11
                                            },
                                            {
                                                name: 'GWP',
                                                type: 'bar',
                                                stack: 'one',
                                                emphasis: emphasisStyle,
                                                data: data21
                                            },
                                            {
                                                name: 'AP',
                                                type: 'bar',
                                                stack: 'one',
                                                emphasis: emphasisStyle,
                                                data: data31
                                            },
                                            {
                                                name: 'EP',
                                                type: 'bar',
                                                stack: 'one',
                                                emphasis: emphasisStyle,
                                                data: data41
                                            }
                                            ,
                                            {
                                                name: 'POCP',
                                                type: 'bar',
                                                stack: 'one',
                                                emphasis: emphasisStyle,
                                                data: data51
                                            }
                                            ,
                                            {
                                                name: 'ODP',
                                                type: 'bar',
                                                stack: 'one',
                                                emphasis: emphasisStyle,
                                                data: data61
                                            }
                                        ]
                                    };
                                    myChartindex.setOption(optionindex);
                                    myChartindex.on('brushSelected', function (params) {
                                        var brushed = [];
                                        var brushComponent = params.batch[0];
                                        for (var sIdx = 0; sIdx < brushComponent.selected.length; sIdx++) {
                                            var rawIndices = brushComponent.selected[sIdx].dataIndex;
                                            brushed.push('[Series ' + sIdx + '] ' + rawIndices.join(', '));
                                        }
                                        myChartindex.setOption({
                                            title: {
                                                backgroundColor: '#333',
                                                bottom: 0,
                                                right: '10%',
                                                width: 100,
                                                textStyle: {
                                                    fontSize: 12,
                                                    color: '#fff'
                                                }
                                            }
                                        });
                                    });












                                    var partgraph = data.data.partGraphVO2;
                                    //产品绿色度展示
                                    var myChart1 = echarts.init(document.getElementById('graphpart')); //选取e-charts图表

                                    option1 = {
                                        title: {
                                            text: '零件LCA分析结果（影响最大的前20个）',
                                            subtext: '',
                                            left: 'center',
                                        },
                                        tooltip: {
                                            trigger: 'axis',
                                            axisPointer: {
                                                type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
                                            }
                                        },
                                        legend: {
                                            top: '6%'
                                        },
                                        grid: {
                                            left: '3%',
                                            right: '4%',
                                            bottom: '3%',
                                            containLabel: true
                                        },
                                        xAxis: {
                                            type: 'value'
                                        },
                                        yAxis: {
                                            type: 'category',
                                            data: partgraph.name
                                        },
                                        series: [

                                            {
                                                name: 'PED',
                                                type: 'bar',
                                                stack: 'total',
                                                label: {
                                                    //show: true,

                                                },
                                                emphasis: {
                                                    focus: 'series'
                                                },
                                                data: partgraph.data1
                                            },
                                            {
                                                name: 'GWP',
                                                type: 'bar',
                                                stack: 'total',
                                                label: {
                                                    //show: true,

                                                },
                                                emphasis: {
                                                    focus: 'series'
                                                },
                                                data: partgraph.data2
                                            },
                                            {
                                                name: 'AP',
                                                type: 'bar',
                                                stack: 'total',
                                                label: {
                                                    //show: true,

                                                },
                                                emphasis: {
                                                    focus: 'series'
                                                },
                                                data: partgraph.data3
                                            },
                                            {
                                                name: 'EP',
                                                type: 'bar',
                                                stack: 'total',
                                                label: {
                                                    //show: true,

                                                },
                                                emphasis: {
                                                    focus: 'series'
                                                },
                                                data: partgraph.data4
                                            }, {
                                                name: 'POCP',
                                                type: 'bar',
                                                stack: 'total',
                                                label: {
                                                    //show: true,

                                                },
                                                emphasis: {
                                                    focus: 'series'
                                                },
                                                data: partgraph.data5
                                            }, {
                                                name: 'ODP',
                                                type: 'bar',
                                                stack: 'total',
                                                label: {
                                                    //show: true,

                                                },
                                                emphasis: {
                                                    focus: 'series'
                                                },
                                                data: partgraph.data6
                                            },
                                        ]
                                    };

                                    myChart1.setOption(option1);

                                    var myChart2 = echarts.init(document.getElementById('pie')); //选取e-charts图表
                                    var pieVO = data.data.pieResultVO;
                                    //包含一个目录
                                    var pie1 = pieVO.name;
                                    var pie2 = []
                                    for (var i = 0; i < pieVO.pie1.length; i++) {
                                        var obj = {value: pieVO.pie1[i].value, name: pieVO.pie1[i].name}
                                        pie2.push(obj);
                                    }
                                    var pie3 = []
                                    for (var i = 0; i < pieVO.pie2.length; i++) {
                                        var obj = {value: pieVO.pie2[i].value, name: pieVO.pie2[i].name}
                                        pie3.push(obj);
                                    }
                                    var pie4 = []
                                    for (var i = 0; i < pieVO.pie3.length; i++) {
                                        var obj = {value: pieVO.pie3[i].value, name: pieVO.pie3[i].name}
                                        pie4.push(obj);
                                    }
                                    //
                                    var option2 = {
                                        title: {
                                            text: '零件影响潜值（一级和二级零件）',
                                            left: 'center',
                                        },
                                        tooltip: {
                                            trigger: 'item',
                                        },
                                        legend: {
                                            data: pie1,
                                            x: 'left',
                                            y: 'bottom',
                                        },
                                        series: [  //一级零件
                                            {
                                                name: '一级零件',
                                                type: 'pie',
                                                selectedMode: 'single',
                                                radius: [0, '35%'],
                                                labelLine: {
                                                    length: 15
                                                },
                                                label: {
                                                    formatter: '{b|{b}：} {per|{d}%}  ',
                                                    backgroundColor: '#F6F8FC',
                                                    borderColor: '#8C8D8E',
                                                    borderWidth: 1,
                                                    borderRadius: 4,
                                                    rich: {
                                                        a: {
                                                            color: '#6E7079',
                                                            lineHeight: 22,
                                                            align: 'center'
                                                        },
                                                        hr: {
                                                            borderColor: '#8C8D8E',
                                                            width: '100%',
                                                            borderWidth: 1,
                                                            height: 0
                                                        },
                                                        b: {
                                                            color: '#4C5058',
                                                            fontSize: 14,
                                                            fontWeight: 'bold',
                                                            lineHeight: 33
                                                        },
                                                        per: {
                                                            color: '#fff',
                                                            backgroundColor: '#4C5058',
                                                            padding: [3, 4],
                                                            borderRadius: 4
                                                        }
                                                    }
                                                },
                                                labelLine: {
                                                    show: true
                                                },
                                                data: pie2
                                            },
                                            {
                                                name: '二级零件',
                                                type: 'pie',
                                                radius: ['55%', '75%'],
                                                labelLine: {
                                                    length: 20
                                                },
                                                label: {
                                                    formatter: ' {b|{b}：}  {per|{d}%}  ',
                                                    backgroundColor: '#F6F8FC',
                                                    borderColor: '#8C8D8E',
                                                    borderWidth: 1,
                                                    borderRadius: 4,
                                                    rich: {
                                                        a: {
                                                            color: '#6E7079',
                                                            lineHeight: 22,
                                                            align: 'center'
                                                        },
                                                        hr: {
                                                            borderColor: '#8C8D8E',
                                                            width: '100%',
                                                            borderWidth: 1,
                                                            height: 0
                                                        },
                                                        b: {
                                                            color: '#4C5058',
                                                            fontSize: 14,
                                                            fontWeight: 'bold',
                                                            lineHeight: 33
                                                        },
                                                        per: {
                                                            color: '#fff',
                                                            backgroundColor: '#4C5058',
                                                            padding: [3, 4],
                                                            borderRadius: 4
                                                        }
                                                    }
                                                },
                                                data: pie3
                                            },
                                            {
                                                name: '三级零件',
                                                type: 'pie',
                                                radius: ['75%', '95%'],
                                                labelLine: {
                                                    length: 10
                                                },
                                                label: {
                                                    formatter: '{a|{a}}{abg|}\n{hr|}\n  {b|{b}：}{c}  {per|{d}%}  ',
                                                    backgroundColor: '#F6F8FC',
                                                    borderColor: '#8C8D8E',
                                                    borderWidth: 1,
                                                    borderRadius: 4,
                                                    rich: {
                                                        a: {
                                                            color: '#6E7079',
                                                            lineHeight: 22,
                                                            align: 'center'
                                                        },
                                                        hr: {
                                                            borderColor: '#8C8D8E',
                                                            width: '100%',
                                                            borderWidth: 1,
                                                            height: 0
                                                        },
                                                        b: {
                                                            color: '#4C5058',
                                                            fontSize: 14,
                                                            fontWeight: 'bold',
                                                            lineHeight: 33
                                                        },
                                                        per: {
                                                            color: '#fff',
                                                            backgroundColor: '#4C5058',
                                                            padding: [3, 4],
                                                            borderRadius: 4
                                                        }
                                                    }
                                                },
                                                data: pie4
                                            }
                                        ]
                                    };
                                    myChart2.setOption(option2);

                                    //lca饼图
                                    var lcapie0 = echarts.init(document.getElementById('lcapie0'));
                                    var lcapie1 = echarts.init(document.getElementById('lcapie1')); //选取e-charts图表
                                    var lcapie2 = echarts.init(document.getElementById('lcapie2')); //选取e-charts图表
                                    var lcapie3 = echarts.init(document.getElementById('lcapie3')); //选取e-charts图表
                                    var lcapie4 = echarts.init(document.getElementById('lcapie4')); //选取e-charts图表
                                    var lcapie5 = echarts.init(document.getElementById('lcapie5')); //选取e-charts图表
                                    var lcapie6 = echarts.init(document.getElementById('lcapie6')); //选取e-charts图表
                                    var lcapie7 = echarts.init(document.getElementById('lcapie7')); //选取e-charts图表
                                    var pieoption0 = {
                                        title: {
                                            text: 'PED',
                                            left: 'center',

                                        },
                                        tooltip: {
                                            trigger: 'item',
                                            formatter: '{a} <br/>{b}: {c} ({d}%)'
                                        },
                                        toolbox: {
                                            show: true,
                                            feature: {
                                                mark: { show: true },
                                                dataView: { show: true, readOnly: false },
                                                restore: { show: true },
                                                saveAsImage: { show: true }
                                            }
                                        },
                                        series: [
                                            {
                                                name: 'Access From',
                                                type: 'pie',
                                                selectedMode: 'single',
                                                radius: [0, '70%'],
                                                label: {
                                                    position: 'inner',
                                                    fontSize: 14
                                                },
                                                labelLine: {
                                                    show: false
                                                },
                                                data: [
                                                    { value: Math.abs(data1[0]), name: '原材料采掘阶段' },
                                                    { value: Math.abs(data2[0]), name: '原材料运输阶段' },
                                                    { value: Math.abs(data3[0]), name: '制造阶段',},
                                                    { value: Math.abs(data4[0]), name: '产品运输阶段',},
                                                    { value: Math.abs(data5[0]), name: '使用阶段',},
                                                    { value: Math.abs(data6[0]), name: '回收阶段',}
                                                ]
                                            }
                                        ]
                                    };
                                    var pieoption1 = {
                                        title: {
                                            text: 'GWP',
                                            left: 'center',

                                        },
                                        tooltip: {
                                            trigger: 'item',
                                            formatter: '{a} <br/>{b}: {c} ({d}%)'
                                        },
                                        toolbox: {
                                            show: true,
                                            feature: {
                                                mark: { show: true },
                                                dataView: { show: true, readOnly: false },
                                                restore: { show: true },
                                                saveAsImage: { show: true }
                                            }
                                        },
                                        series: [
                                            {
                                                name: 'Access From',
                                                type: 'pie',
                                                selectedMode: 'single',
                                                radius: [0, '70%'],
                                                label: {
                                                    position: 'inner',
                                                    fontSize: 14
                                                },
                                                labelLine: {
                                                    show: false
                                                },
                                                data: [
                                                    { value: Math.abs(data1[1]), name: '原材料采掘阶段' },
                                                    { value: Math.abs(data2[1]), name: '原材料运输阶段' },
                                                    { value: Math.abs(data3[1]), name: '制造阶段',},
                                                    { value: Math.abs(data4[1]), name: '产品运输阶段',},
                                                    { value: Math.abs(data5[1]), name: '使用阶段',},
                                                    { value: Math.abs(data6[1]), name: '回收阶段',}
                                                ]
                                            }
                                        ]
                                    };
                                    var pieoption2 = {
                                        title: {
                                            text: 'AP',
                                            left: 'center',

                                        },
                                        tooltip: {
                                            trigger: 'item',
                                            formatter: '{a} <br/>{b}: {c} ({d}%)'
                                        },
                                        toolbox: {
                                            show: true,
                                            feature: {
                                                mark: { show: true },
                                                dataView: { show: true, readOnly: false },
                                                restore: { show: true },
                                                saveAsImage: { show: true }
                                            }
                                        },
                                        series: [
                                            {
                                                name: 'Access From',
                                                type: 'pie',
                                                selectedMode: 'single',
                                                radius: [0, '70%'],
                                                label: {
                                                    position: 'inner',
                                                    fontSize: 14
                                                },
                                                labelLine: {
                                                    show: false
                                                },
                                                data: [
                                                    { value: Math.abs(data1[2]), name: '原材料采掘阶段' },
                                                    { value: Math.abs(data2[2]), name: '原材料运输阶段' },
                                                    { value: Math.abs(data3[2]), name: '制造阶段',},
                                                    { value: Math.abs(data4[2]), name: '产品运输阶段',},
                                                    { value: Math.abs(data5[2]), name: '使用阶段',},
                                                    { value: Math.abs(data6[2]), name: '回收阶段',}
                                                ]
                                            }
                                        ]
                                    };
                                    var pieoption3 = {
                                        title: {
                                            text: 'EP',
                                            left: 'center',

                                        },
                                        tooltip: {
                                            trigger: 'item',
                                            formatter: '{a} <br/>{b}: {c} ({d}%)'
                                        },
                                        toolbox: {
                                            show: true,
                                            feature: {
                                                mark: { show: true },
                                                dataView: { show: true, readOnly: false },
                                                restore: { show: true },
                                                saveAsImage: { show: true }
                                            }
                                        },
                                        series: [
                                            {
                                                name: 'Access From',
                                                type: 'pie',
                                                selectedMode: 'single',
                                                radius: [0, '70%'],
                                                label: {
                                                    position: 'inner',
                                                    fontSize: 14
                                                },
                                                labelLine: {
                                                    show: false
                                                },
                                                data: [
                                                    { value: Math.abs(data1[3]), name: '原材料采掘阶段' },
                                                    { value: Math.abs(data2[3]), name: '原材料运输阶段' },
                                                    { value: Math.abs(data3[3]), name: '制造阶段',},
                                                    { value: Math.abs(data4[3]), name: '产品运输阶段',},
                                                    { value: Math.abs(data5[3]), name: '使用阶段',},
                                                    { value: Math.abs(data6[3]), name: '回收阶段',}
                                                ]
                                            }
                                        ]
                                    };
                                    var pieoption4 = {
                                        title: {
                                            text: 'POCP',
                                            left: 'center',

                                        },
                                        tooltip: {
                                            trigger: 'item',
                                            formatter: '{a} <br/>{b}: {c} ({d}%)'
                                        },
                                        toolbox: {
                                            show: true,
                                            feature: {
                                                mark: { show: true },
                                                dataView: { show: true, readOnly: false },
                                                restore: { show: true },
                                                saveAsImage: { show: true }
                                            }
                                        },
                                        series: [
                                            {
                                                name: 'Access From',
                                                type: 'pie',
                                                selectedMode: 'single',
                                                radius: [0, '70%'],
                                                label: {
                                                    position: 'inner',
                                                    fontSize: 14
                                                },
                                                labelLine: {
                                                    show: false
                                                },
                                                data: [
                                                    { value: Math.abs(data1[4]), name: '原材料采掘阶段' },
                                                    { value: Math.abs(data2[4]), name: '原材料运输阶段' },
                                                    { value: Math.abs(data3[4]), name: '制造阶段',},
                                                    { value: Math.abs(data4[4]), name: '产品运输阶段',},
                                                    { value: Math.abs(data5[4]), name: '使用阶段',},
                                                    { value: Math.abs(data6[4]), name: '回收阶段',}
                                                ]
                                            }
                                        ]
                                    };
                                    var pieoption5 = {
                                        title: {
                                            text: 'ODP',
                                            left: 'center',

                                        },
                                        tooltip: {
                                            trigger: 'item',
                                            formatter: '{a} <br/>{b}: {c} ({d}%)'
                                        },
                                        toolbox: {
                                            show: true,
                                            feature: {
                                                mark: { show: true },
                                                dataView: { show: true, readOnly: false },
                                                restore: { show: true },
                                                saveAsImage: { show: true }
                                            }
                                        },
                                        series: [
                                            {
                                                name: 'Access From',
                                                type: 'pie',
                                                selectedMode: 'single',
                                                radius: [0, '70%'],
                                                label: {
                                                    position: 'inner',
                                                    fontSize: 14
                                                },
                                                labelLine: {
                                                    show: false
                                                },
                                                data: [
                                                    { value: Math.abs(data1[5]), name: '原材料采掘阶段' },
                                                    { value: Math.abs(data2[5]), name: '原材料运输阶段' },
                                                    { value: Math.abs(data3[5]), name: '制造阶段',},
                                                    { value: Math.abs(data4[5]), name: '产品运输阶段',},
                                                    { value: Math.abs(data5[5]), name: '使用阶段',},
                                                    { value: Math.abs(data6[5]), name: '回收阶段',}
                                                ]
                                            }
                                        ]
                                    };
                                    var pieoption6 = {
                                        title: {
                                            text: '环境影响潜值-生命周期阶段',
                                            left: 'center',

                                        },
                                        tooltip: {
                                            trigger: 'item',
                                            formatter: '{a} <br/>{b}: {c} ({d}%)'
                                        },
                                        toolbox: {
                                            show: true,
                                            feature: {
                                                mark: { show: true },
                                                dataView: { show: true, readOnly: false },
                                                restore: { show: true },
                                                saveAsImage: { show: true }
                                            }
                                        },
                                        series: [
                                            {
                                                name: 'Access From',
                                                type: 'pie',
                                                selectedMode: 'single',
                                                radius: [0, '70%'],
                                                label: {
                                                    position: 'inner',
                                                    fontSize: 14
                                                },
                                                labelLine: {
                                                    show: false
                                                },
                                                data: [
                                                    { value: Math.abs(data1[0]+data1[1]+data1[2]+data1[3]+data1[4]+data1[5]), name: '原材料采掘阶段' },
                                                    { value: Math.abs(data2[0]+data2[1]+data2[2]+data2[3]+data2[4]+data2[5]), name: '原材料运输阶段' },
                                                    { value: Math.abs(data3[0]+data3[1]+data3[2]+data3[3]+data3[4]+data3[5]), name: '制造阶段',},
                                                    { value: Math.abs(data4[0]+data4[1]+data4[2]+data4[3]+data4[4]+data4[5]), name: '产品运输阶段',},
                                                    { value: Math.abs(data5[0]+data5[1]+data5[2]+data5[3]+data5[4]+data5[5]), name: '使用阶段',},
                                                    { value: Math.abs(data6[0]+data6[1]+data6[2]+data6[3]+data6[4]+data6[5]), name: '回收阶段',}
                                                ]
                                            }
                                        ]
                                    };
                                    var pieoption7 = {
                                        title: {
                                            text: '环境影响潜值-影响指标',
                                            left: 'center',

                                        },
                                        tooltip: {
                                            trigger: 'item',
                                            formatter: '{a} <br/>{b}: {c} ({d}%)'
                                        },
                                        toolbox: {
                                            show: true,
                                            feature: {
                                                mark: { show: true },
                                                dataView: { show: true, readOnly: false },
                                                restore: { show: true },
                                                saveAsImage: { show: true }
                                            }
                                        },
                                        series: [
                                            {
                                                name: 'Access From',
                                                type: 'pie',
                                                selectedMode: 'single',
                                                radius: [0, '70%'],
                                                label: {
                                                    position: 'inner',
                                                    fontSize: 14
                                                },
                                                labelLine: {
                                                    show: false
                                                },
                                                data: [
                                                    { value: Math.abs(data1[0]+data2[0]+data3[0]+data4[0]+data5[0]+data6[0]), name: 'PED' },
                                                    { value: Math.abs(data1[1]+data2[1]+data3[1]+data4[1]+data5[1]+data6[1]), name: 'GWP' },
                                                    { value: Math.abs(data1[2]+data2[2]+data3[2]+data4[2]+data5[2]+data6[2]), name: 'AP',},
                                                    { value: Math.abs(data1[3]+data2[3]+data3[3]+data4[3]+data5[3]+data6[3]), name: 'EP',},
                                                    { value: Math.abs(data1[4]+data2[4]+data3[4]+data4[4]+data5[4]+data6[4]), name: 'POCP',},
                                                    { value: Math.abs(data1[5]+data2[5]+data3[5]+data4[5]+data5[5]+data6[5]), name: 'ODP',}
                                                ]
                                            }
                                        ]
                                    };
                                    lcapie0.setOption(pieoption0);
                                    lcapie1.setOption(pieoption1);
                                    lcapie2.setOption(pieoption2);
                                    lcapie3.setOption(pieoption3);
                                    lcapie4.setOption(pieoption4);
                                    lcapie5.setOption(pieoption5);
                                    lcapie6.setOption(pieoption6);
                                    lcapie7.setOption(pieoption7);
                                } else {
                                    alert("查看详情失败，原因为" + data.data.errMsg);
                                    window.location.href = "product-result.html";
                                }
                            },
                            error: function (data) {
                                alert("查看详情失败，原因为" + data.responseText);
                                window.location.href = "product-result.html";
                            }
                        });

                    });

                    $("#meta" + products[i].id + "v" + products[i].productId).on("click", function (e) {
                        var id = this.id;
                        id = id.substring(4, id.length);
                        var ids = new Array();
                        ids = id.split("v");
                        $.ajax({
                            type: "GET",
                            contentType: "application/x-www-form-urlencoded",
                            url: "http://" + g_host + "/result/getmeta?calid=" + ids[0] + "&productid=" + ids[1],
                            xhrFields: {withCredentials: true},
                            success: function (data) {

                                if (data.status == "success") {

                                    var noderelation = [];
                                    var nodedata = [];
                                    var myChart = echarts.init(document.getElementById('neo4j2021')); //选取e-charts图表
                                    var myChart1 = echarts.init(document.getElementById('neo4j2022'));
                                    var myChart2 = echarts.init(document.getElementById('neo4j2023'));
                                    var myChart3 = echarts.init(document.getElementById('neo4j2024'));
                                    var myChart4 = echarts.init(document.getElementById('neo4j2025'));
                                    var myChart5 = echarts.init(document.getElementById('neo4j2026'));
                                    var categories = [];//数据节点类型
                                    for (var i = 0; i <= 12; i++) { //设置结点种类
                                        categories[i] = {
                                            name: '等级' + (i + 1),
                                        };
                                    }
                                    nodedata = NodeJsonToArray(data.data.node);
                                    noderelation = RelationJsonToArray(data.data.relations);
                                    option = {
                                        color: ['#FF0000', '#ff5705', '#ff7110', '#ff810c',
                                            '#ffa608', '#ffb710', '#ffcf0c', '#fcd607',
                                            '#ffdf0e', '#ffff0d', '#cbee68', '#83fa1f',
                                            '#47ff31', '#1bff42', '#0db344', '#0bb0b8'],

                                        // 图的标题
                                        title: {
                                            text: '整体绿色度展示'
                                        },
                                        // 提示框的配置
                                        tooltip: {
                                            formatter: function (params) {  //返回结点的提示信息
                                                if (params.data.category != undefined) {//如果触发节点
                                                    return " 材料：" + params.data.material+" 综合绿色度：" + params.data.greenvalue;//返回标签

                                                    /* "系列号：" + params.data.serialInfo + "功能：" + params.data.functionInfo + " 材料：" + params.data.material
                                                     + " 绿色度：" + params.data.greenvalue + " ped：" + params.data.ped + " gwp：" + params.data.gwp
                                                     + " ap：" + params.data.ap + " ep：" + params.data.ep + " pocp：" + params.data.pocp
                                                     + " odp：" + params.data.odp + " 原材料采掘阶段：" + params.data.raw + " 运输阶段：" + params.data.raw_transport
                                                     + " 制造阶段：" + params.data.manufacture + " 回收阶段：" + params.data.recycle;//返回标签*/

                                                } else {//如果触发边
                                                    return params.data.name;
                                                }
                                            }
                                        },
                                        // 工具箱
                                        toolbox: {
                                            // 显示工具箱
                                            show: true,
                                            feature: {
                                                mark: {
                                                    show: true
                                                },
                                                // 还原
                                                restore: {
                                                    show: true
                                                },
                                                // 保存为图片
                                                saveAsImage: {
                                                    show: true
                                                }
                                            }
                                        },
                                        legend: [{
                                            orient: 'vertical',
                                            x: 'left',
                                            y: 'bottom',
                                            // selectedMode: 'single',
                                            data: categories.map(function (a) {
                                                return a.name;
                                            })
                                        }],


                                        series: [{
                                            type: 'graph', // 类型:关系图
                                            layout: 'force', //图的布局，类型为力导图

                                            // 调整节点的大小
                                            roam: true, // 是否开启鼠标缩放和平移漫游。默认不开启。如果只想要开启缩放或者平移,可以设置成 'scale' 或者 'move'。设置成 true 为都开启
                                            scale: true, //开启缩放
                                            move: true, //开启平移
                                            symbol: ['rectangle', 'arrow'],
                                            edgeSymbol: ['rectangle', 'arrow'],
                                            edgeSymbolSize: [2, 10],
                                            edgeLabel: {
                                                normal: {
                                                    textStyle: {
                                                        fontSize: 10   //关系文字字体大小
                                                    }
                                                }
                                            },
                                            force: {
                                                repulsion: 2500,
                                                edgeLength: [10, 50]
                                            },
                                            draggable: true,
                                            lineStyle: {
                                                normal: {
                                                    width: 2,
                                                    color: '#4b565b',
                                                }
                                            },
                                            edgeLabel: {
                                                normal: {
                                                    show: true,
                                                    formatter: function (x) {
                                                        return x.data.name;
                                                    }
                                                }
                                            },
                                            label: {
                                                normal: {
                                                    show: true,
                                                    formatter: function (x) {
                                                        return x.data.des;
                                                    }
                                                }
                                            },

                                            // 数据
                                            data: nodedata,
                                            links: noderelation,
                                            categories: categories,
                                        }],

                                    };
                                    option1 = {
                                        color: ['#FF0000', '#ff5705', '#ff7110', '#ff810c',
                                            '#ffa608', '#ffb710', '#ffcf0c', '#fcd607',
                                            '#ffdf0e', '#ffff0d', '#cbee68', '#83fa1f',
                                            '#47ff31', '#1bff42', '#0db344', '#0bb0b8'],

                                        // 图的标题
                                        title: {
                                            text: '材料域绿色度展示'
                                        },
                                        // 提示框的配置
                                        tooltip: {
                                            formatter: function (params) {  //返回结点的提示信息
                                                if (params.data.category != undefined) {//如果触发节点
                                                    return " 材料：" + params.data.material+ " 原材料采掘阶段绿色度：" + params.data.raw;//返回标签

                                                    /* "系列号：" + params.data.serialInfo + "功能：" + params.data.functionInfo + " 材料：" + params.data.material
                                                     + " 绿色度：" + params.data.greenvalue + " ped：" + params.data.ped + " gwp：" + params.data.gwp
                                                     + " ap：" + params.data.ap + " ep：" + params.data.ep + " pocp：" + params.data.pocp
                                                     + " odp：" + params.data.odp + " 原材料采掘阶段：" + params.data.raw + " 运输阶段：" + params.data.raw_transport
                                                     + " 制造阶段：" + params.data.manufacture + " 回收阶段：" + params.data.recycle;//返回标签*/

                                                } else {//如果触发边
                                                    return params.data.name;
                                                }
                                            }
                                        },
                                        // 工具箱
                                        toolbox: {
                                            // 显示工具箱
                                            show: true,
                                            feature: {
                                                mark: {
                                                    show: true
                                                },
                                                // 还原
                                                restore: {
                                                    show: true
                                                },
                                                // 保存为图片
                                                saveAsImage: {
                                                    show: true
                                                }
                                            }
                                        },
                                        legend: [{
                                            orient: 'vertical',
                                            x: 'left',
                                            y: 'bottom',
                                            // selectedMode: 'single',
                                            data: categories.map(function (a) {
                                                return a.name;
                                            })
                                        }],
                                        series: [{
                                            type: 'graph', // 类型:关系图
                                            layout: 'force', //图的布局，类型为力导图
                                            symbolSize: 40, // 调整节点的大小
                                            roam: true, // 是否开启鼠标缩放和平移漫游。默认不开启。如果只想要开启缩放或者平移,可以设置成 'scale' 或者 'move'。设置成 true 为都开启
                                            scale: true, //开启缩放
                                            move: true, //开启平移
                                            symbol: ['rectangle', 'arrow'],
                                            edgeSymbol: ['rectangle', 'arrow'],
                                            edgeSymbolSize: [2, 10],
                                            edgeLabel: {
                                                normal: {
                                                    textStyle: {
                                                        fontSize: 10   //关系文字字体大小
                                                    }
                                                }
                                            },
                                            force: {
                                                repulsion: 2500,
                                                edgeLength: [10, 50]
                                            },
                                            draggable: true,
                                            lineStyle: {
                                                normal: {
                                                    width: 2,
                                                    color: '#4b565b',
                                                }
                                            },
                                            edgeLabel: {
                                                normal: {
                                                    show: true,
                                                    formatter: function (x) {
                                                        return x.data.name;
                                                    }
                                                }
                                            },
                                            label: {
                                                normal: {
                                                    show: true,
                                                    formatter: function (x) {
                                                        return "名字"+x.data.des+"材料："+x.data.material;
                                                    }
                                                }
                                            },

                                            // 数据
                                            data: NodeJsonToArray1(data.data.node),
                                            links: noderelation,
                                            categories: categories,
                                        }],

                                    };
                                    option2 = {
                                        color: ['#FF0000', '#ff5705', '#ff7110', '#ff810c',
                                            '#ffa608', '#ffb710', '#ffcf0c', '#fcd607',
                                            '#ffdf0e', '#ffff0d', '#cbee68', '#83fa1f',
                                            '#47ff31', '#1bff42', '#0db344', '#0bb0b8'],

                                        // 图的标题
                                        title: {
                                            text: '运输域绿色度展示'
                                        },
                                        // 提示框的配置
                                        tooltip: {
                                            formatter: function (params) {  //返回结点的提示信息
                                                if (params.data.category != undefined) {//如果触发节点
                                                    return " 材料：" + params.data.material+ " 运输绿色度：" + params.data.raw_transport;//返回标签

                                                    /* "系列号：" + params.data.serialInfo + "功能：" + params.data.functionInfo + " 材料：" + params.data.material
                                                     + " 绿色度：" + params.data.greenvalue + " ped：" + params.data.ped + " gwp：" + params.data.gwp
                                                     + " ap：" + params.data.ap + " ep：" + params.data.ep + " pocp：" + params.data.pocp
                                                     + " odp：" + params.data.odp + " 原材料采掘阶段：" + params.data.raw + " 运输阶段：" + params.data.raw_transport
                                                     + " 制造阶段：" + params.data.manufacture + " 回收阶段：" + params.data.recycle;//返回标签*/

                                                } else {//如果触发边
                                                    return params.data.name;
                                                }
                                            }
                                        },
                                        // 工具箱
                                        toolbox: {
                                            // 显示工具箱
                                            show: true,
                                            feature: {
                                                mark: {
                                                    show: true
                                                },
                                                // 还原
                                                restore: {
                                                    show: true
                                                },
                                                // 保存为图片
                                                saveAsImage: {
                                                    show: true
                                                }
                                            }
                                        },
                                        legend: [{
                                            orient: 'vertical',
                                            x: 'left',
                                            y: 'bottom',
                                            // selectedMode: 'single',
                                            data: categories.map(function (a) {
                                                return a.name;
                                            })
                                        }],
                                        series: [{
                                            type: 'graph', // 类型:关系图
                                            layout: 'force', //图的布局，类型为力导图
                                            symbolSize: 40, // 调整节点的大小
                                            roam: true, // 是否开启鼠标缩放和平移漫游。默认不开启。如果只想要开启缩放或者平移,可以设置成 'scale' 或者 'move'。设置成 true 为都开启
                                            scale: true, //开启缩放
                                            move: true, //开启平移
                                            symbol: ['rectangle', 'arrow'],
                                            edgeSymbol: ['rectangle', 'arrow'],
                                            edgeSymbolSize: [2, 10],
                                            edgeLabel: {
                                                normal: {
                                                    textStyle: {
                                                        fontSize: 10   //关系文字字体大小
                                                    }
                                                }
                                            },
                                            force: {
                                                repulsion: 2500,
                                                edgeLength: [10, 50]
                                            },
                                            draggable: true,
                                            lineStyle: {
                                                normal: {
                                                    width: 2,
                                                    color: '#4b565b',
                                                }
                                            },
                                            edgeLabel: {
                                                normal: {
                                                    show: true,
                                                    formatter: function (x) {
                                                        return x.data.name;
                                                    }
                                                }
                                            },
                                            label: {
                                                normal: {
                                                    show: true,
                                                    formatter: function (x) {
                                                        return x.data.des+" "+x.data.transport;
                                                    }
                                                }
                                            },

                                            // 数据
                                            data: NodeJsonToArray2(data.data.node),
                                            links: noderelation,
                                            categories: categories,
                                        }],

                                    };
                                    option3 = {
                                        color: ['#FF0000', '#ff5705', '#ff7110', '#ff810c',
                                            '#ffa608', '#ffb710', '#ffcf0c', '#fcd607',
                                            '#ffdf0e', '#ffff0d', '#cbee68', '#83fa1f',
                                            '#47ff31', '#1bff42', '#0db344', '#0bb0b8'],

                                        // 图的标题
                                        title: {
                                            text: '制造域绿色度展示'
                                        },
                                        // 提示框的配置
                                        tooltip: {
                                            formatter: function (params) {  //返回结点的提示信息
                                                if (params.data.category != undefined) {//如果触发节点
                                                    return " 材料：" + params.data.material+ " 制造绿色度：" + params.data.manufacture;//返回标签

                                                    /* "系列号：" + params.data.serialInfo + "功能：" + params.data.functionInfo + " 材料：" + params.data.material
                                                     + " 绿色度：" + params.data.greenvalue + " ped：" + params.data.ped + " gwp：" + params.data.gwp
                                                     + " ap：" + params.data.ap + " ep：" + params.data.ep + " pocp：" + params.data.pocp
                                                     + " odp：" + params.data.odp + " 原材料采掘阶段：" + params.data.raw + " 运输阶段：" + params.data.raw_transport
                                                     + " 制造阶段：" + params.data.manufacture + " 回收阶段：" + params.data.recycle;//返回标签*/

                                                } else {//如果触发边
                                                    return params.data.name;
                                                }
                                            }
                                        },
                                        // 工具箱
                                        toolbox: {
                                            // 显示工具箱
                                            show: true,
                                            feature: {
                                                mark: {
                                                    show: true
                                                },
                                                // 还原
                                                restore: {
                                                    show: true
                                                },
                                                // 保存为图片
                                                saveAsImage: {
                                                    show: true
                                                }
                                            }
                                        },
                                        legend: [{
                                            orient: 'vertical',
                                            x: 'left',
                                            y: 'bottom',
                                            // selectedMode: 'single',
                                            data: categories.map(function (a) {
                                                return a.name;
                                            })
                                        }],
                                        series: [{
                                            type: 'graph', // 类型:关系图
                                            layout: 'force', //图的布局，类型为力导图
                                            symbolSize: 40, // 调整节点的大小
                                            roam: true, // 是否开启鼠标缩放和平移漫游。默认不开启。如果只想要开启缩放或者平移,可以设置成 'scale' 或者 'move'。设置成 true 为都开启
                                            scale: true, //开启缩放
                                            move: true, //开启平移
                                            symbol: ['rectangle', 'arrow'],
                                            edgeSymbol: ['rectangle', 'arrow'],
                                            edgeSymbolSize: [2, 10],
                                            edgeLabel: {
                                                normal: {
                                                    textStyle: {
                                                        fontSize: 10   //关系文字字体大小
                                                    }
                                                }
                                            },
                                            force: {
                                                repulsion: 2500,
                                                edgeLength: [10, 50]
                                            },
                                            draggable: true,
                                            lineStyle: {
                                                normal: {
                                                    width: 2,
                                                    color: '#4b565b',
                                                }
                                            },
                                            edgeLabel: {
                                                normal: {
                                                    show: true,
                                                    formatter: function (x) {
                                                        return x.data.name;
                                                    }
                                                }
                                            },
                                            label: {
                                                normal: {
                                                    show: true,
                                                    formatter: function (x) {
                                                        return x.data.des+" "+x.data.manu;
                                                    }
                                                }
                                            },

                                            // 数据
                                            data: NodeJsonToArray3(data.data.node),
                                            links: noderelation,
                                            categories: categories,
                                        }],

                                    };
                                    option4 = {
                                        color: ['#1cff49','#40fc0f', '#66ff0a','#a4ff06',
                                            '#d9ff0f','#dfff08','#fbff09','#ffda0c',
                                            '#ff970a', '#ff7309', '#ee500a', '#fa430a',
                                            '#ff1205', '#ff1906', '#b3310b', '#b80911', ],

                                        // 图的标题
                                        title: {
                                            text: '回收域绿色度展示'
                                        },
                                        // 提示框的配置
                                        tooltip: {
                                            formatter: function (params) {  //返回结点的提示信息
                                                if (params.data.category != undefined) {//如果触发节点
                                                    return " 材料：" + params.data.material+ " 回收阶段绿色度：" + params.data.recycle;//返回标签

                                                    /* "系列号：" + params.data.serialInfo + "功能：" + params.data.functionInfo + " 材料：" + params.data.material
                                                     + " 绿色度：" + params.data.greenvalue + " ped：" + params.data.ped + " gwp：" + params.data.gwp
                                                     + " ap：" + params.data.ap + " ep：" + params.data.ep + " pocp：" + params.data.pocp
                                                     + " odp：" + params.data.odp + " 原材料采掘阶段：" + params.data.raw + " 运输阶段：" + params.data.raw_transport
                                                     + " 制造阶段：" + params.data.manufacture + " 回收阶段：" + params.data.recycle;//返回标签*/

                                                } else {//如果触发边
                                                    return params.data.name;
                                                }
                                            }
                                        },
                                        // 工具箱
                                        toolbox: {
                                            // 显示工具箱
                                            show: true,
                                            feature: {
                                                mark: {
                                                    show: true
                                                },
                                                // 还原
                                                restore: {
                                                    show: true
                                                },
                                                // 保存为图片
                                                saveAsImage: {
                                                    show: true
                                                }
                                            }
                                        },
                                        legend: [{
                                            orient: 'vertical',
                                            x: 'left',
                                            y: 'bottom',
                                            // selectedMode: 'single',
                                            data: categories.map(function (a) {
                                                return a.name;
                                            })
                                        }],
                                        series: [{
                                            type: 'graph', // 类型:关系图
                                            layout: 'force', //图的布局，类型为力导图
                                            symbolSize: 40, // 调整节点的大小
                                            roam: true, // 是否开启鼠标缩放和平移漫游。默认不开启。如果只想要开启缩放或者平移,可以设置成 'scale' 或者 'move'。设置成 true 为都开启
                                            scale: true, //开启缩放
                                            move: true, //开启平移
                                            symbol: ['rectangle', 'arrow'],
                                            edgeSymbol: ['rectangle', 'arrow'],
                                            edgeSymbolSize: [2, 10],
                                            edgeLabel: {
                                                normal: {
                                                    textStyle: {
                                                        fontSize: 10   //关系文字字体大小
                                                    }
                                                }
                                            },
                                            force: {
                                                repulsion: 2500,
                                                edgeLength: [10, 10],
                                            },
                                            draggable: true,
                                            lineStyle: {
                                                normal: {
                                                    width: 2,
                                                    color: '#4b565b',
                                                }
                                            },
                                            edgeLabel: {
                                                normal: {
                                                    show: true,
                                                    formatter: function (x) {
                                                        return x.data.name;
                                                    }
                                                }
                                            },
                                            label: {
                                                normal: {
                                                    show: true,
                                                    formatter: function (x) {
                                                        if(x.data.name==="产品"){
                                                            return x.data.des;
                                                        }else{
                                                            return x.data.des+" 回收比例："+x.data.percent+"%";
                                                        }

                                                    }
                                                }
                                            },

                                            // 数据
                                            data: NodeJsonToArray4(data.data.node),
                                            links: noderelation,
                                            categories: categories,
                                        }],

                                    };
                                    option5 = {
                                        color: ['#FF0000', '#ff5705', '#ff7110', '#ff810c',
                                            '#ffa608', '#ffb710', '#ffcf0c', '#fcd607',
                                            '#ffdf0e', '#ffff0d', '#cbee68', '#83fa1f',
                                            '#47ff31', '#1bff42', '#0db344', '#0bb0b8'],

                                        // 图的标题
                                        title: {
                                            text: '功能域绿色度展示'
                                        },
                                        // 提示框的配置
                                        tooltip: {
                                            formatter: function (params) {  //返回结点的提示信息
                                                if (params.data.category != undefined) {//如果触发节点
                                                    return " 材料：" + params.data.material+ "功能：" + params.data.functionInfo;//返回标签

                                                    /* "系列号：" + params.data.serialInfo + "功能：" + params.data.functionInfo + " 材料：" + params.data.material
                                                     + " 绿色度：" + params.data.greenvalue + " ped：" + params.data.ped + " gwp：" + params.data.gwp
                                                     + " ap：" + params.data.ap + " ep：" + params.data.ep + " pocp：" + params.data.pocp
                                                     + " odp：" + params.data.odp + " 原材料采掘阶段：" + params.data.raw + " 运输阶段：" + params.data.raw_transport
                                                     + " 制造阶段：" + params.data.manufacture + " 回收阶段：" + params.data.recycle;//返回标签*/

                                                } else {//如果触发边
                                                    return params.data.name;
                                                }
                                            }
                                        },
                                        // 工具箱
                                        toolbox: {
                                            // 显示工具箱
                                            show: true,
                                            feature: {
                                                mark: {
                                                    show: true
                                                },
                                                // 还原
                                                restore: {
                                                    show: true
                                                },
                                                // 保存为图片
                                                saveAsImage: {
                                                    show: true
                                                }
                                            }
                                        },
                                        legend: [{
                                            orient: 'vertical',
                                            x: 'left',
                                            y: 'bottom',
                                            // selectedMode: 'single',
                                            data: categories.map(function (a) {
                                                return a.name;
                                            })
                                        }],


                                        series: [{
                                            type: 'graph', // 类型:关系图
                                            layout: 'force', //图的布局，类型为力导图

                                            // 调整节点的大小
                                            roam: true, // 是否开启鼠标缩放和平移漫游。默认不开启。如果只想要开启缩放或者平移,可以设置成 'scale' 或者 'move'。设置成 true 为都开启
                                            scale: true, //开启缩放
                                            move: true, //开启平移
                                            symbol: ['rectangle', 'arrow'],
                                            edgeSymbol: ['rectangle', 'arrow'],
                                            edgeSymbolSize: [2, 10],
                                            edgeLabel: {
                                                normal: {
                                                    textStyle: {
                                                        fontSize: 10   //关系文字字体大小
                                                    }
                                                }
                                            },
                                            force: {
                                                repulsion: 2500,
                                                edgeLength: [10, 50]
                                            },
                                            draggable: true,
                                            lineStyle: {
                                                normal: {
                                                    width: 2,
                                                    color: '#4b565b',
                                                }
                                            },
                                            edgeLabel: {
                                                normal: {
                                                    show: true,
                                                    formatter: function (x) {
                                                        return x.data.name;
                                                    }
                                                }
                                            },
                                            label: {
                                                normal: {
                                                    show: true,
                                                    formatter: function (x) {
                                                        return x.data.des;
                                                    }
                                                }
                                            },

                                            // 数据
                                            data: NodeJsonToArray5(data.data.node),
                                            links: noderelation,
                                            categories: categories,
                                        }],

                                    };
                                    myChart.setOption(option);
                                    myChart1.setOption(option1);
                                    myChart2.setOption(option2);
                                    myChart3.setOption(option3);
                                    myChart4.setOption(option4);
                                    myChart5.setOption(option5);
                                } else {
                                    alert("查看详情失败，原因为" + data.data.errMsg);
                                    window.location.href = "product-result.html";
                                }
                            },
                            error: function (data) {
                                alert("查看详情失败，原因为" + data.responseText);
                                window.location.href = "product-result.html";
                            }
                        });

                    });

                    //删除方法
                    $("#delete" + products[i].id + "v" + products[i].productId).on("click", function (e) {
                        var id = this.id;
                        id = id.substring(6, id.length);
                        var ids = new Array();
                        ids = id.split("v");
                        //submitid = id;
                        console.log(ids[0]);
                        console.log(ids[1]);
                        $.ajax({
                            type: "GET",
                            contentType: "application/x-www-form-urlencoded",
                            url: "http://" + g_host + "/result/delete?calid=" + ids[0] + "&productid=" + ids[1],
                            xhrFields: {withCredentials: true},
                            success: function (data) {
                                if (data.status == "success") {
                                    alert("删除成功！");
                                    window.location.href = "product-result.html";
                                } else {
                                    alert("删除失败，原因为" + data.data.errMsg);
                                    window.location.href = "product-result.html";
                                }
                            },
                            error: function (data) {
                                alert("删除失败，原因为" + data.responseText);
                                window.location.href = "product-result.html";
                            }
                        });

                    });

                }

            }

            //列表详情的模态窗口
            function reloadInfoDom() {
                for (var i = 0; i < productInfo.length; i++) {
                    var dom = [(i + 1), productInfo[i].name, productInfo[i].type, productInfo[i].serial, productInfo[i].greenvalue,
                        productInfo[i].ped, productInfo[i].gwp, productInfo[i].ap, productInfo[i].ep,
                        productInfo[i].pocp, productInfo[i].odp];
                    $('.my-model-info').dataTable().fnAddData(dom);
                }
            }
            function NodeJsonToArray(nodes) {

                var mydata = [];
                for (var i = 0; i < nodes.length; i++) {
                    var n = {
                        name: nodes[i].orderInfo,
                        des: nodes[i].name,
                        symbolSize: [110,40],
                        category: nodes[i].l1,
                        serialInfo: nodes[i].serialInfo,
                        functionInfo: nodes[i].functionInfo,
                        material: nodes[i].material,
                        greenvalue: nodes[i].greenvalue,
                        ped: nodes[i].ped,
                        gwp: nodes[i].gwp,
                        ap: nodes[i].ap,
                        ep: nodes[i].ep,
                        pocp: nodes[i].pocp,
                        odp: nodes[i].odp,
                        raw: nodes[i].raw,
                        transport:nodes[i].transport,
                        manu:nodes[i].manu,
                        percent:nodes[i].percent,
                        raw_transport: nodes[i].raw_transport,
                        pro_transport: nodes[i].pro_transport,
                        pro_use: nodes[i].pro_use,
                        manufacture: nodes[i].manufacture,
                        recycle: nodes[i].recycle,
                    }
                    mydata.push(n);
                }

                return mydata;
            }
            function NodeJsonToArray1(nodes) {

                var mydata = [];
                for (var i = 0; i < nodes.length; i++) {
                    var n = {
                        name: nodes[i].orderInfo,
                        des: nodes[i].name,
                        symbolSize: [110,40],
                        category: nodes[i].l2,
                        serialInfo: nodes[i].serialInfo,
                        functionInfo: nodes[i].functionInfo,
                        material: nodes[i].material,
                        greenvalue: nodes[i].greenvalue,
                        ped: nodes[i].ped,
                        gwp: nodes[i].gwp,
                        ap: nodes[i].ap,
                        ep: nodes[i].ep,
                        transport:nodes[i].transport,
                        manu:nodes[i].manu,
                        percent:nodes[i].percent,
                        pocp: nodes[i].pocp,
                        odp: nodes[i].odp,
                        raw: nodes[i].raw,
                        raw_transport: nodes[i].raw_transport,
                        pro_transport: nodes[i].pro_transport,
                        pro_use: nodes[i].pro_use,
                        manufacture: nodes[i].manufacture,
                        recycle: nodes[i].recycle,
                    }
                    mydata.push(n);
                }

                return mydata;
            }
            function NodeJsonToArray2(nodes) {

                var mydata = [];
                for (var i = 0; i < nodes.length; i++) {
                    var n = {
                        name: nodes[i].orderInfo,
                        des: nodes[i].name,
                        symbolSize: [110,40],
                        category: nodes[i].l3,
                        serialInfo: nodes[i].serialInfo,
                        functionInfo: nodes[i].functionInfo,
                        material: nodes[i].material,
                        greenvalue: nodes[i].greenvalue,
                        ped: nodes[i].ped,
                        transport:nodes[i].transport,
                        manu:nodes[i].manu,
                        percent:nodes[i].percent,
                        gwp: nodes[i].gwp,
                        ap: nodes[i].ap,
                        ep: nodes[i].ep,
                        pocp: nodes[i].pocp,
                        odp: nodes[i].odp,
                        raw: nodes[i].raw,
                        raw_transport: nodes[i].raw_transport,
                        pro_transport: nodes[i].pro_transport,
                        pro_use: nodes[i].pro_use,
                        manufacture: nodes[i].manufacture,
                        recycle: nodes[i].recycle,
                    }
                    mydata.push(n);
                }

                return mydata;
            }
            function NodeJsonToArray3(nodes) {

                var mydata = [];
                for (var i = 0; i < nodes.length; i++) {
                    var n = {
                        name: nodes[i].orderInfo,
                        des: nodes[i].name,
                        symbolSize: [110,40],
                        category: nodes[i].l4,
                        serialInfo: nodes[i].serialInfo,
                        functionInfo: nodes[i].functionInfo,
                        material: nodes[i].material,
                        greenvalue: nodes[i].greenvalue,
                        ped: nodes[i].ped,
                        transport:nodes[i].transport,
                        manu:nodes[i].manu,
                        percent:nodes[i].percent,
                        gwp: nodes[i].gwp,
                        ap: nodes[i].ap,
                        ep: nodes[i].ep,
                        pocp: nodes[i].pocp,
                        odp: nodes[i].odp,
                        raw: nodes[i].raw,
                        raw_transport: nodes[i].raw_transport,
                        pro_transport: nodes[i].pro_transport,
                        pro_use: nodes[i].pro_use,
                        manufacture: nodes[i].manufacture,
                        recycle: nodes[i].recycle,
                    }
                    mydata.push(n);
                }

                return mydata;
            }
            function NodeJsonToArray4(nodes) {

                var mydata = [];
                for (var i = 0; i < nodes.length; i++) {
                    var n = {
                        name: nodes[i].orderInfo,
                        des: nodes[i].name,
                        symbolSize: [110,40],
                        category: nodes[i].l5,
                        serialInfo: nodes[i].serialInfo,
                        functionInfo: nodes[i].functionInfo,
                        material: nodes[i].material,
                        greenvalue: nodes[i].greenvalue,
                        ped: nodes[i].ped,
                        gwp: nodes[i].gwp,
                        ap: nodes[i].ap,
                        transport:nodes[i].transport,
                        manu:nodes[i].manu,
                        percent:nodes[i].percent,
                        ep: nodes[i].ep,
                        pocp: nodes[i].pocp,
                        odp: nodes[i].odp,
                        raw: nodes[i].raw,
                        raw_transport: nodes[i].raw_transport,
                        pro_transport: nodes[i].pro_transport,
                        pro_use: nodes[i].pro_use,
                        manufacture: nodes[i].manufacture,
                        recycle: nodes[i].recycle,
                    }
                    mydata.push(n);
                }

                return mydata;
            }
            //功能域函数
            function NodeJsonToArray5(nodes) {

                var mydata = [];
                for (var i = 0; i < nodes.length; i++) {
                    var n = {
                        name: nodes[i].orderInfo,
                        des: nodes[i].name+" "+nodes[i].functionInfo,
                        symbolSize: [110,40],
                        category: nodes[i].l1,
                        serialInfo: nodes[i].serialInfo,
                        functionInfo: nodes[i].functionInfo,
                        material: nodes[i].material,
                        greenvalue: nodes[i].greenvalue,
                        ped: nodes[i].ped,
                        gwp: nodes[i].gwp,
                        ap: nodes[i].ap,
                        transport:nodes[i].transport,
                        manu:nodes[i].manu,
                        percent:nodes[i].percent,
                        ep: nodes[i].ep,
                        pocp: nodes[i].pocp,
                        odp: nodes[i].odp,
                        raw: nodes[i].raw,
                        raw_transport: nodes[i].raw_transport,
                        pro_transport: nodes[i].pro_transport,
                        pro_use: nodes[i].pro_use,
                        manufacture: nodes[i].manufacture,
                        recycle: nodes[i].recycle,
                    }
                    mydata.push(n);
                }

                return mydata;
            }
            function RelationJsonToArray(relations) {
                var mydata = [];
                for (var i = 0; i < relations.length; i++) {
                    if (relations[i].parent == null) continue;
                    var n = {
                        source: relations[i].parent,
                        target: relations[i].child,
                        name: relations[i].name,
                        des: relations[i].des
                    }
                    mydata.push(n);
                }
                return mydata;

            }


        </script>
    </div>

</div>

<!--查看数据列表详情的模态窗口 class="main-content"-->
<div class="modal fade" id="list_detail0" role="dialog">
    <div class="modal-dialog" style="width:1600px">
        <div class="modal-content" style="height: 750px">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span>×</span>
                </button>
                <center>
                    <h3 class="modal-title">
                        列表结果
                    </h3>
                </center>
            </div>


            <table class="table table-bordered table-striped datatable  my-model-info" id="table-2">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>产品名称</th>
                    <th>产品系列号(s)</th>
                    <th>产品厂家</th>
                    <th>地区</th>

                    <th>产品产地</th>
                    <th>目的地</th>
                    <th>产品功率</th>
                    <th>运输距离</th>
                    <th>产品寿命</th>

                    <th>产品重量</th>

                </tr>
                </thead>
                <tbody>

                </tbody>
            </table>


        </div>
    </div>
</div>

<!--查看数据列表的方法-->
<script type="text/javascript">
    jQuery(window).load(function () {
        var responsiveHelper;
        var breakpointDefinition = {
            tablet: 1024,
            phone: 480
        };
        var tableContainer;
        var $ = jQuery;

        $("#table-2").dataTable({
            "sPaginationType": "bootstrap",
            "iDisplayLength": 15,
            "aLengthMenu": [[11, 12, 13, 14, 15], [11, 12, 13, 14, 15]],
            "bStateSave": true,
            "bInfo": true,
            "aoColumns": [
                {"sTitle": "ID"},
                {"sTitle": "名称"},
                {"sTitle": "类型"},
                {"sTitle": "型号"},
                {"sTitle": "绿色度"},
                {"sTitle": "初级能源消耗 PED"},
                {"sTitle": "温室效应 GWP"},
                {"sTitle": "酸化 AP"},
                {"sTitle": "富营养化 EP"},
                {"sTitle": "光化学污染 POCP"},
                {"sTitle": "臭氧层破坏 ODP"},
            ],
        });

        $(".dataTables_wrapper select").select2({
            minimumResultsForSearch: -1
        });

    });


</script>

<div class=" modal fade" id="list_detail1" role="dialog">
    <div class="modal-dialog" style="width:70%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span>×</span>
                </button>
                <center>
                    <h3 class="modal-title">
                        图表结果
                    </h3>
                </center>
            </div>

            <div style="padding-left: 20px;padding-right: 20px">

                <ul class="nav nav-tabs bordered "><!-- available classes "bordered", "right-aligned" -->
                    <li class="active">
                        <a href="#g1" data-toggle="tab">
                            <span class="visible-xs"><i class="entypo-home"></i></span>
                            <span class="hidden-xs">产品LCA柱状图展示</span>
                        </a>
                    </li>
                    <li >
                        <a href="#g13" data-toggle="tab">
                            <span class="visible-xs"><i class="entypo-home"></i></span>
                            <span class="hidden-xs">产品LCA饼图展示</span>
                        </a>
                    </li>
                    <li>
                        <a href="#g2" data-toggle="tab">
                            <span class="visible-xs"><i class="entypo-user"></i></span>
                            <span class="hidden-xs">零件LCA柱状图展示</span>
                        </a>
                    </li>
                    <li>
                        <a href="#g3" data-toggle="tab">
                            <span class="visible-xs"><i class="entypo-mail"></i></span>
                            <span class="hidden-xs">零件LCA饼图展示</span>
                        </a>
                    </li>
                </ul>

                <div class="tab-content">
                    <div class="tab-pane active" id="g1">
                        <div class="modal-body" style="height: 700px;">
                            <div id="graphmid" style="width:1200px;height:700px"></div>
                        </div>
                        <div class="modal-body" style="height: 700px;">
                            <div id="graphmid1" style="width:1200px;height:700px"></div>
                        </div>
                    </div>
                    <div class="tab-pane" id="g13" style="height: 1000px">

                        <div class="modal-body" style="height: 300px;float: left;">
                            <div id="lcapie0" style="width:360px;height:300px"></div>
                        </div>
                        <div class="modal-body" style="height: 300px;float: left">
                            <div id="lcapie1" style="width:360px;height:300px"></div>
                        </div>
                        <div class="modal-body" style="height: 300px;float: left">
                            <div id="lcapie2" style="width:360px;height:300px"></div>
                        </div>
                        <div class="modal-body" style="height: 300px;float: left">
                            <div id="lcapie3" style="width:360px;height:300px"></div>
                        </div>
                        <div class="modal-body" style="height: 300px;float: left">
                            <div id="lcapie4" style="width:360px;height:300px"></div>
                        </div>
                        <div class="modal-body" style="height: 300px;float: left">
                            <div id="lcapie5" style="width:360px;height:300px"></div>
                        </div>
                        <div class="modal-body" style="height: 400px;float: left;padding-left: 200px">
                            <div id="lcapie6" style="width:400px;height:400px"></div>
                        </div>
                        <div class="modal-body" style="height: 400px;float: left;">
                            <div id="lcapie7" style="width:400px;height:400px"></div>
                        </div>
                    </div>
                    <div class="tab-pane" id="g2">
                        <div class="modal-body" style="height: 700px;">
                            <div id="graphpart" style="width:1200px;height:670px;padding-left:55px"></div>
                        </div>
                    </div>
                    <div class="tab-pane" id="g3">
                        <div class="modal-body" style="height: 750px;">
                            <div id="pie" style="width:1200px;height:720px;padding-left: -20px"></div>
                        </div>
                    </div>
                </div>


            </div>

        </div>
    </div>
</div>


<div class="modal fade" id="list_detail2" role="dialog">
    <div class="modal-dialog" style="width:90%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span>×</span>
                </button>
                <center>
                    <h3 class="modal-title">
                        多域关联展示
                    </h3>
                </center>

                <div style="padding-left: 20px;padding-right: 20px">

                    <ul class="nav nav-tabs bordered "><!-- available classes "bordered", "right-aligned" -->
                        <li class="active">
                            <a href="#w1" data-toggle="tab">
                                <span class="visible-xs"><i class="entypo-home"></i></span>
                                <span class="hidden-xs">绿色度展示</span>
                            </a>
                        </li>
                        <li>
                            <a href="#w2" data-toggle="tab">
                                <span class="visible-xs"><i class="entypo-user"></i></span>
                                <span class="hidden-xs">材料域</span>
                            </a>
                        </li>
                        <li>
                            <a href="#w3" data-toggle="tab">
                                <span class="visible-xs"><i class="entypo-mail"></i></span>
                                <span class="hidden-xs">运输域</span>
                            </a>
                        </li>
                        <li>
                            <a href="#w4" data-toggle="tab">
                                <span class="visible-xs"><i class="entypo-mail"></i></span>
                                <span class="hidden-xs">制造域</span>
                            </a>
                        </li>
                        <li>
                            <a href="#w5" data-toggle="tab">
                                <span class="visible-xs"><i class="entypo-mail"></i></span>
                                <span class="hidden-xs">回收域</span>
                            </a>
                        </li>
                        <li>
                            <a href="#w6" data-toggle="tab">
                                <span class="visible-xs"><i class="entypo-mail"></i></span>
                                <span class="hidden-xs">功能域</span>
                            </a>
                        </li>
                    </ul>

                    <div class="tab-content">
                        <div class="tab-pane active" id="w1">
                            <div class="modal-body" style="height: 700px;">
                                <div id="neo4j2021" style="width:1550px;height:700px;padding-bottom: 50px"></div>
                            </div>
                        </div>
                        <div class="tab-pane" id="w2">
                            <div class="modal-body" style="height: 700px;">
                                <div id="neo4j2022" style="width:1550px;height:700px;padding-bottom:50px"></div>
                            </div>
                        </div>
                        <div class="tab-pane" id="w3">
                            <div class="modal-body" style="height: 700px;">
                                <div id="neo4j2023" style="width:1550px;height:700px;padding-bottom: 50px"></div>
                            </div>
                        </div>
                        <div class="tab-pane" id="w4">
                            <div class="modal-body" style="height: 700px;">
                                <div id="neo4j2024" style="width:1550px;height:700px;padding-bottom: 50px"></div>
                            </div>
                        </div>
                        <div class="tab-pane" id="w5">
                            <div class="modal-body" style="height: 700px;">
                                <div id="neo4j2025" style="width:1550px;height:700px;padding-bottom: 50px"></div>
                            </div>
                        </div>
                        <div class="tab-pane" id="w6">
                            <div class="modal-body" style="height: 700px;">
                                <div id="neo4j2026" style="width:1550px;height:700px;padding-bottom: 50px"></div>
                            </div>
                        </div>
                    </div>


                </div>
            </div>

        </div>
    </div>
</div>
<div class=" modal fade" id="bomtips" role="dialog">
    <div class="modal-dialog" style="width:40%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span>×</span>
                </button>
                <center>
                    <h4 class="modal-title">
                        Bom填写小提示
                    </h4>
                </center>
            </div>

            <div style="padding-left: 20px;padding-right: 20px">

                <ul class="nav nav-tabs bordered "><!-- available classes "bordered", "right-aligned" -->
                    <li class="active">
                        <a href="#g11" data-toggle="tab">
                            <span class="visible-xs"><i class="entypo-home"></i></span>
                            <span class="hidden-xs">产品Bom</span>
                        </a>
                    </li>
                    <li>
                        <a href="#g21" data-toggle="tab">
                            <span class="visible-xs"><i class="entypo-mail"></i></span>
                            <span class="hidden-xs">工艺Bom</span>
                        </a>
                    </li>
                    <li>
                        <a href="#g31" data-toggle="tab">
                            <span class="visible-xs"><i class="entypo-mail"></i></span>
                            <span class="hidden-xs">运输Bom</span>
                        </a>
                    </li>
                    <li>
                        <a href="#g41" data-toggle="tab">
                            <span class="visible-xs"><i class="entypo-user"></i></span>
                            <span class="hidden-xs">材料Bom</span>
                        </a>
                    </li>
                </ul>

                <div class="tab-content">
                    <div class="tab-pane active" id="g11">
                        <div class="modal-body" style="height: 550px;">
                            <p><strong>产品Bom</strong>一共包含16列，分别为 序号、代号、名称、型号、功能、参数、每台数量、材料、单重(kg)、总重(kg)、备注、产地、运输距离（km）、运输方式、工艺方式、回收（百分比）。</p>
                            <p><strong>1、</strong> *序号：产品序号需要按照目录结构一样进行编写，1、1.1、1.2、2、2.1、2.2... （序号直接必须有层级关系，必须父级存在的时候才能编写子序号，否则无法进行计算！）</p>
                            <p><strong>2、</strong> 代号：代号表示企业内部对零部件的编号，可以不写！</p>
                            <p><strong>3、</strong> *名称：代表该零件的名字，必须填写，否则无法计算！</p>
                            <p><strong>4、</strong> 型号：为该零部件的零件型号，请如实填写，当其他数据缺失时，此型号信息将作为智能填补的重要依据！</p>
                            <p><strong>5、</strong> 功能：该零部件的主要作用,尽量填写，该信息将作为智能填补的依据！</p>
                            <p><strong>6、</strong> 参数：该零部件的其他参数，可以不写！</p>
                            <p><strong>7、</strong> *每台数量：每台产品所包含该零部件的数量</p>
                            <p><strong>8、</strong> *材料：该零部件的主要材料，如果是装配体，就写装配体！叶子节点的零件必须填写材料（材料信息不可缺失，如不知道请填写 null 后台会自动补全）</p>
                            <p><strong>9、</strong> *单重(kg)：一个零部件的重量，单位kg</p>
                            <p><strong>10、</strong> *总重(kg)：一台产品中该零部件的总重（该数据不可缺失！如不清楚请填写0，后台会智能补全）</p>
                            <p><strong>11、</strong> 备注：零部件的备注，可以为空，如过数据经过后台智能补全，补全信息会出现在这一栏里！</p>
                            <p><strong>12、</strong> 产地：零部件的产地</p>
                            <p><strong>13、</strong> *运输距离（km）：零部件的运输距离，必须填写！如不知道请填写0，后台会自动补全！</p>
                            <p><strong>14、</strong> *运输方式：运输方式必须填写，先查看背景运输数据填写，如不知道，请填写null后台会自动补全！</p>
                            <p><strong>15、</strong> *工艺方式：零部件的加工工工艺，先查看背景工艺数据再填写（多个工艺请用-分开，比如 切削粗加工共-切削半精加工共-切削精加工），该数据不能缺失！如不清楚请填写null后台会自动补全！如果物料没有制造阶段，请填写不计算，后台会自动跳过制造阶段！</p>
                            <p><strong>16、</strong> *回收：填写回收的百分比，（整数），该数据不可缺失！，如不清楚请填写0，后台会自动补全！</p>
                            <p><strong>注：</strong>*号为必填内容，如果不清楚请填写null（非数值型数据）和0（数值型数据）</p>
                        </div>
                    </div>
                    <div class="tab-pane" id="g21">
                        <div class="modal-body" style="height: 550px;">
                            <p><strong>工艺Bom</strong>一共包含24列，分别为工艺名称、工艺类型、机床型号、机床功率、加工材料、单位、材料去除率、数据来源、备注、煤、石油、天然气、co、co2、so2、nox、ch4、h2s、hcl、cod、nh3、cfc11、cfc12、cfc113

                            </p>

                            <p><strong>1、</strong> *工艺名称：表示该工艺的名字，需要加上加工工类型，该信息为后台计算匹配的唯二信息，不可缺失！</p>
                            <p><strong>2、</strong> *工艺类型：表示该工艺类型（比如：粗加工、半精加工、精加工...）</p>
                            <p><strong>3、</strong> 机床型号：表示加工零部件的机床代号</p>
                            <p><strong>4、</strong> 机床功率：实际功率</p>
                            <p><strong>5、</strong> *加工材料：该工艺所加工的材料,该信息作为后台计算匹配的唯二信息，不可缺失！</p>
                            <p><strong>6、</strong> 单位：kg （加工1kg该材料所产生的环境排放）</p>
                            <p><strong>7、</strong> *材料去除率：该信息不可缺失！,Double类型的数据，请如实填写</p>
                            <p><strong>8、</strong> 数据来源：填写你的数据来源</p>
                            <p><strong>9、</strong> 备注：用户备注</p>
                            <p><strong>10、</strong> *其他：环境排放的数值，小数位数最多支持20位,这些列的信息不可缺失！</p>
                            <p><strong>注：</strong>*号为必填内容，如果缺失将无法计算！</p>
                            <p><strong>注：</strong>该bom的数据单位为比能耗，即加工1kg物质所产生的电能，单位为kwh/cm3,需要用户将其转化为电能,然后和1kwh的电能所产生的环境排放进行等比例扩大或缩小！ </p>
                            <p><strong>比能耗转化为电能计算公式：</strong> 比能耗（kwh/cm3） × 10^6 ÷ 材料密度（kg/m3）= 我们的单位（kwh/kg）</p>

                        </div>
                    </div>
                    <div class="tab-pane" id="g31">
                        <div class="modal-body" style="height: 550px;">
                            <p><strong>运输Bom</strong>一共包含22列，分别为运输名称、运输工具、单位、地区、数据来源 、运输类型（陆运、水运）
                                、备注、煤、石油、天然气、co、co2、so2、nox、ch4、h2s、hcl、cod、nh3、cfc11、cfc12、cfc113
                            </p>

                            <p><strong>1、</strong> *运输名称：表示该运输的名字，该信息为后台计算匹配的唯一信息，不可缺失！</p>
                            <p><strong>2、</strong> 运输工具：表示该运输所使用的工具信息</p>
                            <p><strong>3、</strong> 单位：kg/km</p>
                            <p><strong>4、</strong> 地区：表示该运输数据来自哪个地区</p>
                            <p><strong>5、</strong> 数据来源：该信息你是从哪里搜集到的，请如实填写！</p>
                            <p><strong>6、</strong> 运输类型：陆运、水运、空运...</p>
                            <p><strong>7、</strong> 备注：用户备注</p>
                            <p><strong>8、</strong> *其他：环境排放的数值，小数位数最多支持20位,这些列的信息不可缺失！</p>
                            <p><strong>注：</strong>*号为必填内容，如果缺失将无法计算！</p>
                            <p><strong>注：</strong>此表中所有数据单位均为kg/km 无法变更，需要您自行转换输入！</p>

                        </div>
                    </div>
                    <div class="tab-pane" id="g41">
                        <div class="modal-body" style="height: 550px;">
                            <p><strong>材料Bom</strong>一共包含20列，分别为材料名称、类型（物质、能量、排放）、单位、地区、数据来源、备注
                                、煤、石油、天然气、co、co2、so2、nox、ch4、h2s、hcl、cod、nh3、cfc11、cfc12、cfc113
                            </p>

                            <p><strong>1、</strong> *材料名称：表示该运输的名字，该信息为后台计算匹配的唯一信息，不可缺失！</p>
                            <p><strong>2、</strong> 类型：该物质的类型（物质、能量、排放...）</p>
                            <p><strong>3、</strong> 单位：kg 固定不变 需要用户自行换算</p>
                            <p><strong>4、</strong> 地区：表示该物质数据来自哪个地区</p>
                            <p><strong>5、</strong> 数据来源：该信息你是从哪里搜集到的，请如实填写！</p>
                            <p><strong>7、</strong> 备注：用户备注</p>
                            <p><strong>8、</strong> *其他：环境排放的数值，小数位数最多支持20位,这些列的信息不可缺失！</p>
                            <p><strong>注：</strong>*号为必填内容，如果缺失将无法计算！</p>
                            <p><strong>注：</strong>此表中所有数据单位均为kg 无法变更，需要您自行转换输入！</p>
                        </div>
                    </div>
                </div>


            </div>

        </div>
    </div>
</div>

<link rel="stylesheet" href="static/css/datatables.responsive.css">
<link rel="stylesheet" href="static/css/select2-bootstrap.css">
<link rel="stylesheet" href="static/css/select2.css">

<!-- Bottom Scripts -->
<script src="static/js/main-gsap.js"></script>
<script src="static/js/jquery-ui-1.10.3.minimal.min.js"></script>
<script src="static/js/bootstrap.js"></script>
<script src="static/js/joinable.js"></script>
<script src="static/js/resizeable.js"></script>
<script src="static/js/neon-api.js"></script>
<script src="static/js/jquery.dataTables.min.js"></script>
<script src="static/js/TableTools.min.js"></script>
<script src="static/js/dataTables.bootstrap.js"></script>
<script src="static/js/jquery.dataTables.columnFilter.js"></script>
<script src="static/js/lodash.min.js"></script>
<script src="static/js/datatables.responsive.js"></script>
<script src="static/js/select2.min.js"></script>
<script src="static/js/neon-chat.js"></script>
<script src="static/js/neon-custom.js"></script>
<script src="static/js/neon-demo.js"></script>
<script src="static/js/fileinput.js"></script>
<!--导入echarts库-->
<script src="https://cdn.staticfile.org/echarts/4.7.0/echarts.js"></script>


</body>

</html>